package com.uzhie.exception;

import com.uzhie.web.bean.ErrorBean;

/**
 * 用户操作自定义错误
 * Created by lilongfei on 2018/7/12.
 */
public class RoleException extends BussException {
    private int status = -1;
    private String message;

    public RoleException(String error) {
        this(0, error);
    }

    public RoleException(int status, String error) {
        super(error);
    }

    public int getStatus() {
        return status;
    }

    public void setStatus(int status) {
        this.status = status;
    }

    public ErrorBean getError(){
        ErrorBean error = new ErrorBean();
        error.setCode(status);
        error.setMsg(getMessage());
        return error;
    }

    public class Status {
        public final static String INSERT_ERROR = "角色添加失败";
        public final static String MENU_ISNULL = "菜单数据不可为空";
        public final static String UPDATA_ERROR = "角色更新失败";
        public final static String DELETE_MENU_ERROR = "角色删除失败";
        public final static String UPDATA_STATUS_ERROR = "角色状态更新失败";
        public final static String ID_ISNULL = "角色id不能为空";
        public final static String ROLE_ISNULL = "角色对象不能为空";
    }
}
